package wjh.mapper;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import wjh.pojo.Admin;

public interface AdminInfoMapper {

    @Select("select * from admin where id=#{value}")
    Admin findAdminById(int id);

    @Update("update admin set username=#{username},password=#{password} where id=#{id}")
    void updateInfo(Admin admin);

    @Select("select * from admin where username=#{value}")
    Admin findUserByName(String username);

//    @Select("select * from admin where username=#{value} and password=#{value}")
    Admin findAdminLogin(@Param("username") String username,@Param("password") String password);

//    @Select("select id from admin where username=#{value} and password=#{value}")
    Admin findId(@Param("username") String username,@Param("password") String password);

    @Select("select * from admin where username=#{value}")
    Admin findAdminRegister(String username);

    void register(@Param("username") String username,@Param("password") String password);
}
